package com.winenine999.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.winenine999.custom.dao.CWineryMapper;
import com.winenine999.generator.dao.WineryMapper;
import com.winenine999.jdbc.dao.WineryDao;
import com.winenine999.model.Page;
import com.winenine999.model.Winery;
import com.winenine999.service.IWineryService;
@Service
public class WineryService implements IWineryService {
	@Autowired
	private WineryMapper wineryMapper;
	@Autowired
	private CWineryMapper cWineryMapper;
	@Autowired
	private WineryDao wineryDao;
	/**
	 * 根据id删除winery
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
		
		return wineryMapper.deleteByPrimaryKey(id);
	}
	/**
	 * 选择字段插入winery
	 */
	@Override
	public int insertSelective(Winery winery) {
		
		return wineryMapper.insertSelective(winery);
	}
	/**
	 * 选择字段修改winery
	 */
	@Override
	public int updateByPrimaryKeySelective(Winery winery) {
		
		return wineryMapper.updateByPrimaryKeySelective(winery);
	}
	/**
	 * 根据id查询winery
	 */
	@Override
	public Winery selectByPrimaryKey(Integer id) {
		
		return wineryMapper.selectByPrimaryKey(id);
	}
	//------------------------custom---------------------------------
	/**
	 * 全查winery
	 */
	@Override
	public List<Map<String, Object>> findAllWinerys() {
		
		return cWineryMapper.findAllWinerys();
	}
	/**
	 * 分页查询winerys
	 */
	@Override
	public Page findPageWinerys(Page page) {
		
		return wineryDao.findPageWinerys(page);
	}

}
